luci-theme: add missing menu name to page `<title>`
authorSelf-Hosting-Group <[email protected]>
Thu, 25 Sep 2025 00:00:00 +0000 (00:00 +0000)
committerPaul Donald <[email protected]>
Wed, 3 Dec 2025 20:47:13 +0000 (21:47 +0100)
Signed-off-by: Self-Hosting-Group <[email protected]>
themes/luci-theme-bootstrap/ucode/template/themes/bootstrap/header.ut
themes/luci-theme-material/ucode/template/themes/material/header.ut
themes/luci-theme-openwrt-2020/ucode/template/themes/openwrt2020/header.ut
themes/luci-theme-openwrt/ucode/template/themes/openwrt.org/header.ut

index 9e5e3a2381ede5353e499f80bd89ffa995560ae9..85216214e9b233ae918c5555c921e1f6b63b7449 100644 (file)
@@ -18,7 +18,7 @@
 <html lang="{{ dispatcher.lang }}" {{ darkpref ? `data-darkmode="${darkpref}"` : '' }}>
        <head>
                <meta charset="utf-8">
-               <title>{{ striptags(`${boardinfo.hostname ?? '?'}${node ? ` - ${node.title}` : ''}`) }} - LuCI</title>
+               <title>{{ striptags(`${dispatched ? `${dispatched.title} | ` : ''}${boardinfo.hostname ?? '?'}`) }} | LuCI</title>
                {% if (!darkpref): %}
                        <script>
                                var mediaQuery = window.matchMedia('(prefers-color-scheme: dark)'),
index b0c48b4736b8c883381154d5d54a477c5ab5daee..e46ec9f287ccab59eecaa2a88ecc63090c2752ec 100644 (file)
@@ -22,7 +22,6 @@
        import { getuid, getspnam } from 'luci.core';
 
        const boardinfo = ubus.call('system', 'board');
-       const hostname = striptags(boardinfo?.hostname ?? '?');
 
        http.prepare_content('text/html; charset=UTF-8');
 -%}
@@ -37,8 +36,8 @@
 <meta name="theme-color" content="#09c">
 <meta name="msapplication-tap-highlight" content="no">
 <meta name="msapplication-TileColor" content="#09c">
-<meta name="application-name" content="{{ hostname }} - LuCI">
-<meta name="apple-mobile-web-app-title" content="{{ hostname }} - LuCI">
+<meta name="application-name" content="{{ striptags(`${dispatched ? `${dispatched.title} | ` : ''}${boardinfo.hostname ?? '?'}`) }} | LuCI">
+<meta name="apple-mobile-web-app-title" content="{{ striptags(`${dispatched ? `${dispatched.title} | ` : ''}${boardinfo.hostname ?? '?'}`) }} | LuCI">
 <link rel="stylesheet" href="{{ media }}/cascade.css">
 <link rel="icon" href="{{ media }}/logo_48.png" sizes="48x48">
 <link rel="icon" href="{{ media }}/logo.svg" sizes="any">
@@ -47,7 +46,7 @@
 {% endif %}
 <script src="{{ dispatcher.build_url('admin/translations', dispatcher.lang) }}"></script>
 <script src="{{ resource }}/cbi.js"></script>
-<title>{{ hostname }}{{ node?.title ? ` - ${striptags(node.title)}` : '' }} - LuCI</title>
+<title>{{ striptags(`${dispatched ? `${dispatched.title} | ` : ''}${boardinfo.hostname ?? '?'}`) }} | LuCI</title>
 {% if (css): %}
 <style title="text/css">{{ css }}</style>
 {% endif %}
@@ -58,7 +57,7 @@
                <div class="container">
                        <span class="showSide"></span>
                        <a id="logo" href="{{ ctx.authsession ? dispatcher.build_url('admin/status/overview') : '#' }}"><img src="{{ media }}/brand.png" alt="OpenWrt"></a>
-                       <a class="brand" href="#">{{ hostname }}</a>
+                       <a class="brand" href="#">{{ striptags(`${boardinfo.hostname ?? '?'}`) }}</a>
                        <span class="status" id="indicators"></span>
                </div>
        </div>
index 56443bd9cbb9e0d7f1e31c0fa5c3603747a67267..25a1719eea8fdfe8ddcf3d1ccd589f639029ad5c 100644 (file)
@@ -22,7 +22,7 @@
 <link rel="icon" href="{{ media }}/logo.svg" sizes="any">
 <script src="{{ dispatcher.build_url('admin/translations', dispatcher.lang) }}"></script>
 <script src="{{ resource }}/cbi.js"></script>
-<title>{{ striptags(`${boardinfo.hostname ?? '?'}${node ? ` - ${node.title}` : ''}`) }} - LuCI</title>
+<title>{{ striptags(`${dispatched ? `${dispatched.title} | ` : ''}${boardinfo.hostname ?? '?'}`) }} | LuCI</title>
 {% if (css): %}
 <style title="text/css">{{ css }}</style>
 {% endif %}
index b7a6abae6856420df703dd05ebfcb426aff82226..a1773aa62ec122ed3aa8a269383b5f42a33791c0 100644 (file)
@@ -28,7 +28,7 @@
 <script src="{{ dispatcher.build_url('admin/translations', dispatcher.lang) }}"></script>
 <script src="{{ resource }}/cbi.js"></script>
 
-<title>{{ striptags(`${boardinfo.hostname ?? '?'}${node ? ` - ${_(node.title)}` : ''}`) }} - LuCI</title>
+<title>{{ striptags(`${dispatched ? `${dispatched.title} | ` : ''}${boardinfo.hostname ?? '?'}`) }} | LuCI</title>
 </head>
 <body class="lang_{{ dispatcher.lang }}" data-page="{{ entityencode(join('-', ctx.request_path), true) }}">